<?php
/**
 * @version     1.0.0
 * @package     com_general
 * @copyright   Copyright (C) 2012. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Quang <quang4it@yahoo.com> - http://quang.com
 */
// no direct access
defined('_JEXEC') or die;
//$template = JFactory::getApplication()->getTemplate();
if ($this->items) {
    foreach ($this->cats as $k => $catItems) {
        if ($catItems->parent_id == 1) {
            ?>
            <div class="slider_block clearfix">
            <h2><?php echo $catItems->title; ?></h2>
                <div id="" class="ps_slider">
                    <a class="prev disabled"></a>
                    <a class="next disabled"></a>
                    <div class="ps_albums">
                        <?php
                        foreach ($this->items as $k => $item) {
                            $categories = stristr($item->categories, ",") && $item->categories ? explode(",", $item->categories) : array(0 => $item->categories);
                            if (in_array($catItems->id, $categories)) {
                                $image = $item->image;
                                ?>
                                <div class="ps_album" style="opacity:0;">
                                    <input type="hidden" value="<?php echo $item->id; ?>" name="album_id" class="album_id"/>
                                    <img src="<?php echo JURI::base() . $image; ?>" alt=""/>
                                    <div class="ps_desc">
                                        <h2>The Night</h2>
                                        <span>Top Cat! The most effectual Top Cat! Who's intellectual close friends get to call him T.C., providing it's with dignity.Top Cat! The indisputable leader!</span>
                                    </div>
                                </div>
                                <?php
                            }
                        }
                        ?>
                    </div>	
                </div>
            </div>
            <?php
        }
    }
    ?>

    <div id="ps_overlay" class="ps_overlay" style="display:none;"></div>
    <a id="ps_close" class="ps_close" style="display:none;"></a>
    <div id="ps_container" class="ps_container" style="display:none;">
        <a id="ps_next_photo" class="ps_next_photo" style="display:none;"></a>
    </div>
    <?php
} else {
    ?>

    There are no items in the list

<?php }; ?>